//
//  UndirectedCommunication.m
//  KConnect
//
//  Created on 18/03/09.
//  Copyright 2009 Xtreme Labs Inc. All rights reserved.
//

#import "KCUndirectedCommClick.h"

#define kUCommClick     @"ucc"

#define kUID            @"uid"
#define kType           @"tu"
#define kAppInstalled   @"i"
#define kShortTracking  @"su"
#define kSubType1       @"st1"
#define kSubType2       @"st2" 

#define kDefaultAppInstalled @"1"



@implementation KCUndirectedCommClick

- (id)initWithUID:(NSString*)uid type:(NSString*)type
{
  NSDictionary *required = [NSDictionary dictionaryWithObjectsAndKeys:
                            uid,  kUID, 
                            type, kType,  
                            kDefaultAppInstalled, kAppInstalled,
                            nil];
  
  if (self = [super initWithParameters:required])
  {
    
  }
  
  return self;
}

- (void)setSubType1:(NSString*)subtype
{
  [self addOptionalParameter:kSubType1 value:subtype];  
}

- (void)setSubType2:(NSString*)subtype
{
  [self addOptionalParameter:kSubType2 value:subtype];
}


#pragma mark KCMessage Subclass
- (NSString*)messageType
{
  return kUCommClick;
}

- (NSArray*)requiredParameters
{
  return [NSArray arrayWithObjects:
          kUID,
          kType,
          kAppInstalled,
          nil];
}

- (NSArray*)optionalParameters
{
	return [NSArray arrayWithObjects:
          kShortTracking,
          kSubType1,
          kSubType2,
          nil];
}



@end
